package org.client.otdr;

import java.net.URL;

import javafx.scene.layout.Pane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;

public class WebClientPane extends Pane {

	public WebClientPane(String url) {
		
		this.setMinHeight(550);
		this.setMinWidth(320);
		
		WebView webView = new WebView();
		final WebEngine webEngine = webView.getEngine();
		
		if (url.contains("http") && url.contains("://")) {
			webEngine.load(url);
		}
		else {
			URL urlHello = getClass().getResource(url);
	        webEngine.load(urlHello.toExternalForm());	
		}

        webView.prefHeightProperty().bind(this.heightProperty());
        webView.prefWidthProperty().bind(this.widthProperty());
        this.getChildren().add(webView);
	}

	public WebClientPane() {
		
	}
}
